Skip to content

fix(spec,metadata-protocol): a dashboard's packaged translation catalog yields to a published org overlay (#20680) - #20728

Merged
objectstack-fleet[bot] merged 5 commits into
mainfrom
claude/issue-20680-builtin-dashboard-overlay-identity
Sep 29, 2026
Merged

objectstack-fleet[bot] merged 5 commits into
mainfrom
claude/issue-20680-builtin-dashboard-overlay-identity

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Part of #20680. This PR lands the two producer halves: the translator rule in @objectstack/spec and the packaged-base accessor in @objectstack/metadata-protocol. Two halves stay open, so the card must stay open after this merges. The first is the packages/rest read-path face, which hands the dashboard's packaged base to the translation; triage names it a per-layer child, and the seat files it, dashboards only, blocked by this PR (seat answer 5900364303 on #20680). The second is the console renderer, which is not measured here (see the acceptance notes).

Clause-②: yes

The identity, measured first (as the dispatch ordered)

Harness. @objectstack/verify's bootStack(showcaseStack, { orgContext: true }), which boots the real showcase composition in process: HTTP through the real Hono app, SQLite, an org-bound admin, and a member of the same org who signed up. The tree is origin/main at 5757463712. I spied on sys_metadata findOne during direct protocol.getMetaItem calls to see which branch answered. The probe was a scratch file and is not committed.

step identity used branch that answered widget title served
PUT …/system_overview?mode=draft row type: dashboard, name: system_overview, package_id: null, organization_id: ORG, state: draft write stored "Total Users (edited-20680)"
POST …/publish the same row, state: active write stored the edit
protocol.getMetaItem({ organizationId: ORG }) lookup type: dashboard, name, state: active, organization_id: ORG (no package filter) step 1, the sys_metadata overlay lookup, which hit that row edited
protocol.getMetaItems({ organizationId: ORG }) union read overlay row edited
GET …?layers=true (admin and member) the same row layered read overlay and effective edited, overlayScope: org
GET /api/v1/meta/dashboard/system_overview (admin and member) the same protocol read, then the REST translation overlay, then translateDashboard "Total Users" (en), "用户总数" (zh-CN)
GET /api/v1/meta/dashboard (admin and member; this list is what the console builds the board from) the same the same "Total Users" / "用户总数"
control showcase_ops_dashboard, same boot identical row shape (package_id: null, same org) the same edited, both doors

The served _packageId: com.objectstack.plugin-auth is the code artifact's protection envelope. mergeArtifactProtection grafts it onto the overlay body, and plugin-auth's manifest registers SystemOverviewDashboard. It is not a second identity that the overlay missed.

Hypotheses. H1 (the write and the plain read disagree on package_id): falsified. H2 (an earlier branch answers before the overlay lookup): falsified, because step 1 answered. H3 (the list read carries its own mismatch): falsified at the protocol; the REST list shows the same translation effect as the item read. H4 (the control works because it is keyed differently): falsified, because both are keyed identically. The difference is that platform-objects ships an en bundle whose dashboards.system_overview.widgets.WIDGET_ID.title repeats each shipped title, while the showcase bundle carries no widget titles for its dashboard. H5 (packages/rest is not the cause): partly held. REST is not where the wrong value is produced, but its read path is where the base has to be threaded in, so that half is the per-layer child.

The producer. translateDashboard (packages/spec/src/system/i18n-resolver.ts) applied the catalog over whatever the document said. ADR-0029 D9.2a records one rule for both object layers, an explicit override beats a packaged default, and #8284 implemented it for objects' three scalars only. This PR applies the same comparison to dashboards.

What changes

  • translateDashboard takes TranslateDocumentOptions (previously ResolveOptions; the new type adds only the optional packagedBase). When a base is supplied, the catalog replaces a string only while that string still equals its packaged counterpart. The rule covers the dashboard label and description, each widget's title, description and sub-caption (options.description), each global filter's label, and each static option label. Each string is matched by the key the bundle uses for it: widget id, filter key, or option value. A part that the base does not carry counts as authored, following the object rule "a base that declares no such scalar". With no base, the output is byte-identical to before.
  • The comparison is still one implementation. scalarOverridesPackagedBase now delegates to a private valueOverridesPackagedBase that takes any key. Its exported signature is unchanged, and its body is the same three lines.
  • ObjectStackProtocolImplementation.getPackagedDashboardBase(name) is the dashboard twin of getPackagedObjectBase. It is lookupArtifactItem('dashboard', name) and nothing wider, so an overlay hydrated under the plain registry key can never come back as the base. It answers undefined for a dashboard no code package ships, for an unknown or empty name, and for a registry that cannot answer.

Readers of the changed functions, and which served answers move

  • translateDashboard is reached only through translateMetadataDocument('dashboard', …) in packages/rest/src/meta-item-read-gate.ts, by both translateMetaDocument (item) and translateMetaList (list). Both pass packagedBase: packagedObjectBaseOf(…), which is undefined for every type but object. So no serving path supplies a dashboard base today, and the new branch never runs in production until the REST child lands. objectui imports none of these functions; it mentions them in comments only.
  • scalarOverridesPackagedBase is read by translateObject (spec) and by the SchemaRegistry fold (packages/objectql/src/registry.ts, the ADR-0029 D9.2a precedence). Its semantics are unchanged. The objectql suite, 6682 tests, is green against the rebuilt spec dist.
  • getPackagedDashboardBase has no caller yet. The REST child is its first reader.

Before/after, measured in the real boot. I ran the same probe on two builds. The before build was 5757463712, in a throwaway worktree. The after build was this branch, with @objectstack/spec and @objectstack/metadata-protocol rebuilt. Each run covered admin and member, en and zh-CN, and three phases: pristine; after publishing overlays on system_overview and showcase_ops_dashboard; and after resetting both. Each run read the dashboard list and each item (all 4 dashboards), the view list (35 views), the app list, and 4 object items (showcase_project, showcase_account, showcase_task, sys_user). I compared label, title, filter and option strings plus a normalized hash of every body. Differences: 0. No other dashboard, view, app or object changes its answer with this PR alone.

Positive controls in the same runs. Unedited translated items keep their translations in zh-CN: system_overview "系统概览" / "用户总数"; the showcase global filters "任务状态" and "区域", with their option labels; views "进行中" and "紧急"; the app "功能展示"; objects "项目", "任务" and "用户". showcase_account keeps serving its extension label "Account (Success Overlay)", which is the #8284 object path, unchanged.

The whole chain with the REST face applied (a throwaway worktree, not this branch): a nine-line change to meta-item-read-gate.ts passes getPackagedDashboardBase(name) for dashboard. With it, the same probe differs from this branch in exactly 16 fields, all of them system_overview's edited widget, for admin and member, en and zh-CN, item and list (title, plus the body hashes). The edit is served in both locales, the unedited sibling widget stays translated ("活跃会话"), reset restores "Total Users" / "用户总数", and the showcase control is unchanged. That is the card's pin set, measured one layer up from this PR.

Published surface (for the Clause-② line)

No documented rule is reversed

Tests

HEAD d89ebb8c1c for everything below.

  • packages/spec/src/system/i18n-resolver.test.ts, a new block of 9 tests. It covers an untouched document (catalog applied to every string), an edited title in en and zh-CN, per-string judgement, every string kind, a tenant-added widget, no base as the pre-change control, the ruled no-op edge, no mutation of inputs, and the generic dispatcher. The whole spec local project passed: 575 files, 16969 tests.
  • packages/objectql/src/protocol-packaged-dashboard-base.test.ts, 8 tests against a real SchemaRegistry. It covers the packaged body, immunity to an overlay hydrated under the plain key, the three undefined answers, the item read serving the overlay (one identity), translation plus base serving the edit in both locales while the sibling stays translated, the no-base control reproducing the defect, and reset. The objectql local project passed: 336 files, 6682 tests.
  • @objectstack/metadata-protocol passed: 190 files, 2792 tests. typecheck is green for spec (with its test layer), metadata-protocol and objectql (with its test layer).
  • Ablation 1 (spec, source-resolved, scripts/ablation-replace.mjs): the widget-title guard was replaced with false && …; the anchor went from 1 to 0 and the blob changed. The -t 20680 run turned 3 red: the edited title, the tenant-added widget, and the dispatcher. The file was restored, with blob equal to HEAD and git diff HEAD empty.
  • Ablation 2 (metadata-protocol, through dist): the accessor was made to return registry.getItem (the trap). After a rebuild, ablation-dist-preflight found the marker in 2 built files, and 2 tests went red: shadow immunity, and the no-code-package case. Restore leg: rebuild, --absent over 24 built files, tree clean, 8 of 8 green.
  • Gates: node scripts/pm/dispatch-gates.mjs --commands derived 96 families. I ran all 96 at d89ebb8c1c and all exited 0. --ran reconciliation: "96 derived, 96 run, 0 NOT-MEASURED, 0 UNRUN". check:engine-double-contract asked for the new double to be recorded, so scripts/engine-double-contract.pinned.json gains one findOne row, written by the gate's --write. check:objectql-double-limit asked for the double's find to honour limit.
  • Narrowed lint: eslint --no-inline-config --format json over the 4 TypeScript files in the diff reported 4 files, 0 errors and 0 warnings. That population comes from the config's own files glob (**/*.{ts,tsx,mts,cts,js,jsx,mjs,cjs}); the other 3 changed paths are .md and .json. The config never enables type-aware linting (its own header says so: no parserOptions.project), so this diff cannot move the verdict for an untouched file.

Acceptance notes

  • Dormant until the REST child. With this PR alone, no served answer changes (measured above). The translations.mdx sentence describing the rule for dashboards belongs with the child that makes the rule observable.
  • The console's board is not measured. Read from objectui source at 9fd6c2c, not at the pinned dd3f7e1, which is absent locally: DashboardRenderer's tWidgetTitle re-resolves dashboards.NAME.widgets.WIDGET_ID.title client-side, and a bundle entry wins over the served title. If so, the rendered board would keep the shipped string even after the server serves the edit. This is a read-only inference and no card is filed. The carrier is the REST child's browser verification.
  • A same-family reading on views (measured in this boot): an org overlay on showcase_task.in_progress ("In Progress (edited-20680)") is served in en, but a zh-CN reader, admin or member, item or list, gets "进行中". This is the same catalog-over-overlay shape one type over. The seat files it as its own finding (5900364303); it is not fixed here.
  • The branch is 7 commits behind origin/main, and none of them touches these paths. The merge queue rebuilds the PR on the current main.

Generated by Claude Code

…nd the packaged dashboard base

Claude-Session: https://claude.ai/code/session_01DEvba2nBuD4tWzfq8r8NFY
Co-authored-by: Claude <noreply@anthropic.com>
…catalog-vs-override fix

Claude-Session: https://claude.ai/code/session_01DEvba2nBuD4tWzfq8r8NFY
Co-authored-by: Claude <noreply@anthropic.com>
…pinned in the engine-double ledger

Claude-Session: https://claude.ai/code/session_01DEvba2nBuD4tWzfq8r8NFY
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/l documentation Improvements or additions to documentation protocol:system tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Sep 29, 2026
@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 2 package(s): @objectstack/metadata-protocol, @objectstack/spec, touching 11 documentable anchor(s).

4 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/concepts/metadata-lifecycle.mdx (via ObjectStackProtocolImplementation (symbol, a top-level class))
  • content/docs/deployment/validating-metadata.mdx (via globalFilters (literal, a string literal in packagedDashboardPart; a string literal in translateDashboard))
  • content/docs/ui/dashboards.mdx (via globalFilters (literal, a string literal in packagedDashboardPart; a string literal in translateDashboard))
  • content/docs/ui/translations.mdx (via subCaption (literal, a string literal in translateDashboard))

⛔ 2 release-owned page(s) also name something this change touched. These are read-only:

  • content/docs/releases/v16.mdx (via ObjectStackProtocolImplementation (symbol, a top-level class), globalFilters (literal, a string literal in packagedDashboardPart; a string literal in translateDashboard))
  • content/docs/releases/v17/17-0.mdx (via ObjectStackProtocolImplementation (symbol, a top-level class))

content/docs/releases/ is RELEASE-OWNED (AGENTS.md "Documentation Guardrails"): release
notes are written centrally at release time, and a code PR that edits them is the exact PR
that guardrail exists to stop. They are still audited — read-only. If one of them is actually
wrong, file an issue or open a dedicated docs-only PR; do not edit it here.

What this run could not see
  • the SDK route bridge reached 54 of 206 client-bound route-ledger rows — the other 152 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 152: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 55 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 97 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 138 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json b291fcdae9ac6dd4152367082905cfe81ddf5fb0 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 8f0b676dfc519cf9324b49319dd2f066f53595ec — the merge of head 8f538b1a442fdc9b44112ddd480a2ab61692d24b into base b291fcdae9ac6dd4152367082905cfe81ddf5fb0, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 8f0b676dfc519cf9324b49319dd2f066f53595ec && git checkout 8f0b676dfc519cf9324b49319dd2f066f53595ec
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin b291fcdae9ac6dd4152367082905cfe81ddf5fb0 8f538b1a442fdc9b44112ddd480a2ab61692d24b && git checkout -B drift-repro b291fcdae9ac6dd4152367082905cfe81ddf5fb0 && git merge --no-ff 8f538b1a442fdc9b44112ddd480a2ab61692d24b

node scripts/docs-audit/affected-docs.mjs --json b291fcdae9ac6dd4152367082905cfe81ddf5fb0

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs b291fcdae9ac6dd4152367082905cfe81ddf5fb0 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

… minor (Clause-② yes, widening)

Claude-Session: https://claude.ai/code/session_01DEvba2nBuD4tWzfq8r8NFY
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 8f538b1a442fdc9b44112ddd480a2ab61692d24b
Local-runs: none

Inputs: card #20680 (body, triage 5895803688, claim 5898553291, os-dev-report 5900307018, seat answer 5900364303, delta report 5900438073), PR #20728 (body, file list, net diff against origin/main at merge-base 5757463712, 7 files, +582 / -9), the check-runs on the head, and the governing texts on origin/main (ADR-0029 D9.2a, ADR-0126 Regime O, content/docs/ui/translations.mdx, packages/rest/src/meta-item-read-gate.ts, packages/objectql/src/registry.ts). Nothing was built, run or re-run.

Check-runs on the head, read once (no polling), posted 2026-09-29T22:49Z: 39 runs, 18 success, 5 skipped, 16 in_progress, 0 failure. In progress at the read: Build Core, Test Core 1-6, Dogfood 1-3 and Verify CLI, Temporal Conformance, Lint and Repo Gates, Type Check workspace / consumer gates / debt ledger. Success at the read includes Check Changeset (both runs), Governed Surface Queue Guard, Part-of PR must not also close its card (both runs), Spec property liveness, Type Check source gates. A green landing still waits on the in-progress set; that is the queue's second condition, not this record's.

① Derived judgments

  1. @objectstack/spec (./system, published via the package exports map): translateDashboard(doc, bundle, opts) widens its accept set — opts goes from ResolveOptions to TranslateDocumentOptions, so the optional packagedBase is now accepted and acted on. RIGHT. TranslateDocumentOptions extends ResolveOptions and adds only that optional key, so every existing call compiles; the dispatch table METADATA_DOCUMENT_TRANSLATORS was already typed with TranslateDocumentOptions, and translateMetadataDocument already passed it through. packages/spec/api-surface/system.json pins export names only (translateDashboard (function)) and api-surface-signatures.json does not pin this function, so no regenerated spec artifact is owed by this diff; Type Check source gates is success on the head.
  2. Without a base the output is byte-identical to origin/main. RIGHT, traced: asRecord(undefined | null) is undefined; packagedDashboardPart(undefined, …) is undefined for the filter, the option and the widget; valueOverridesPackagedBase(undefined, …) is false on every one of the seven guards, so every branch falls to the pre-change lookup. Pinned by the no-base control (undefined and null) in i18n-resolver.test.ts.
  3. With a base the comparison is per string over exactly the seven strings the bundle addresses: dashboard label and description; widget title, description and sub-caption (options.description); global-filter label; static option label. RIGHT. Each is matched by the bundle's own key (widget id; filter key via globalFilterKey, name else field; option String(value)). A widget, filter or option the base lacks resolves to {}, so undefined !== value counts it as authored — the same answer scalarOverridesPackagedBase({}, key, value) gives for a scalar the packaged object never declared, so the object rule's "a base that declares no such scalar" is carried over exactly. An edit back to the shipped string compares equal and the catalog still applies (the ruled no-op edge). A non-string label (an inline locale map) never counts as an override, so the map route documented in translations.mdx is untouched. Inputs are not mutated (the copy is built as before). translateGlobalFilter's signature change is module-private, not a public change.
  4. scalarOverridesPackagedBase delegation: the exported signature (its three-key union included) is unchanged; its body is now one call to the private valueOverridesPackagedBase, whose body is the same three lines. RIGHT — the ADR-0029 D9.2a "one comparison, one implementation" requirement holds, and both readers on origin/main (translateObject, and the SchemaRegistry fold at packages/objectql/src/registry.ts:2503) read the same predicate unchanged. Nit, not blocking: the exported predicate's doc still says its edges are "load-bearing in two places" and TranslateDocumentOptions.packagedBase still says "See translateObject for the rule it feeds" — both are now one caller short; belongs to the next touch of the file.
  5. @objectstack/metadata-protocol (exports["."], index.ts line 3 exports the class): ObjectStackProtocolImplementation.getPackagedDashboardBase(name): unknown is a new public method — a public-surface widening. RIGHT. The shadow case: it is lookupArtifactItem('dashboard', name) and nothing wider, which is SchemaRegistry.getArtifactItem — composite-key (packageId:name) scan first with isCodeArtifactBody, then the bare-key fallback with the same predicate (dashboard is not a discriminated type, so the plain three-tier path applies). It cannot return a tenant overlay: (a) a per-org overlay — the card's case — is never hydrated into the registry at all (hydrateOverlayIntoRegistry returns false for organizationId !== null, ADR-0005); (b) an env-wide overlay hydrates under the BARE key only, and although mergeArtifactProtection then grafts the artifact's _packageId and _provenance onto it (so it looks like a code body), the composite scan runs first and returns the packaged entry; (c) the bare fallback can only win when no composite entry exists, in which case nothing was grafted, stateTenantAuthorship leaves _provenance: 'org', and isCodeArtifactBody excludes it. The undefined edges are as documented: a non-string or empty name; no registry; a registry double with neither getArtifactItem nor getItem; any throw. The doc's "a dashboard has no extension fold" is true — ADR-0126 Regime E is object and app only, and spec declares no dashboard extension. One edge that is not a tenant overlay and outside this card: two code packages shipping the same dashboard name resolve by Map insertion order, the same order getMetaItem's envelope already uses.
  6. "With this PR alone no served answer changes." RIGHT, from origin/main: translateMetaDocument computes packagedBase only when metaType === 'object'; translateMetaList passes packagedObjectBaseOf(...), whose first line returns undefined for every type but object; the only other translateMetadataDocument caller (rest-server.ts:10418) is hard-coded 'object'; no non-test source in the repo imports translateDashboard directly (comments only); getPackagedDashboardBase has no caller on the branch outside its test. The new branch is dormant until rest: the /meta dashboard item and list reads pass no packaged base to translateDashboard, so a published org overlay on a translated dashboard keeps the shipped widget title — per-layer child of #20680 #20730.
  7. scripts/engine-double-contract.pinned.json (+5): one {file, verb: findOne, pinned: 1} row for the new objectql test, whose findOne double routes through assertEngineFindOnePredicate; the file is the gate's GENERATED grow-only coverage ledger and the row sits alphabetically before its object sibling. RIGHT — a coverage gain, not debt.
  8. packages/objectql/src/protocol-packaged-dashboard-base.test.ts: @objectstack/metadata-protocol and @objectstack/spec are declared objectql dependencies; the sibling protocol-packaged-object-base.test.ts exists on main; the find double honours limit; it reads nothing outside its package. RIGHT. The eight pins (packaged body, shadow immunity, the three undefined answers, the host-cannot-answer double, the item read serving the overlay, translation with the base in en and zh-CN with the sibling still translated, the no-base control, reset) cover the accessor and the read it feeds.

② Semver level

  • PR body line: Clause-②: yes (no arm — the rule allows at most one, none required). RIGHT: both facts in ① are widenings (a new accepted key on a published function; a new public method on an exported class). The claim's original no was corrected in-seat at 5900364303 and the body now carries the correction.
  • .changeset/20680-spec-dashboard-catalog-override.md: '@objectstack/spec': minor. .changeset/20680-metadata-protocol-packaged-dashboard-base.md: '@objectstack/metadata-protocol': minor. Both RIGHT under WHICH LEVEL (pr-automation.yml): a purely additive widening of a published package's public surface takes at least minor, and a fix( type never lowers it. Check Changeset is success on this head (both runs), and the level axis is live (the dev's control leg at d89ebb8c1c with patch reds it).
  • Neither package removes or renames anything, so no BREAKING banner, no migration text and no ADR-0087 disposition is owed. skip-changeset would be wrong here and is not used.
  • Changeset prose, sentence by sentence: every factual sentence in both files holds against the diff and origin/main — the seven strings, the key matching, "counts as authored" for missing parts, byte-identical without a base, the no-op edge, "no serving layer in this release passes a dashboard base yet", the accessor reading the code-package entry only, the three undefined cases, "the item and list reads already serve a published org overlay by the same identity the write stored" (pinned by the objectql item-read test), "nothing is removed or renamed". TRUE.
  • PR body as squash message: Part of #20680 first line, no closing keyword anywhere in the body, and the "Part-of PR must not also close its card" check is success; the body says the card stays open for the REST face and the console renderer, which is what the seat answer 5900364303 and the delta report say too. CONSISTENT. "The tree is origin/main at 5757463712" is the merge-base. TRUE. "HEAD d89ebb8c1c for everything below": the head differs from it by two frontmatter words only. TRUE. "The branch is 7 commits behind origin/main, and none of them touches these paths": the count is 12 at this read; the diffstat of 5757463712..origin/main over the seven paths is still empty, so the load-bearing half holds and the number is a stale reading, not a false claim. "objectui imports none of these functions": not verifiable from the inputs and not load-bearing (nothing is removed or renamed; no base is passed). The measured tables and counts are the dev's runs; nothing in the diff contradicts them.

③ Boundary flags

  1. Landing site outside the original claim (spec i18n-resolver.ts as the measured producer; the objectql real-registry test; the pinned JSON): ANSWERED. The seat amended the claim's file surface at 5900364303; the producer is where the catalog was applied over authored text, and the fix is at the producer as PD12 requires; the objectql test sits beside its object sibling because metadata-protocol declares no SchemaRegistry dependency; the pinned JSON is the gate's own --write. Accepted.
  2. Readers of the changed functions: ANSWERED, verified in ① items 4 and 6.
  3. Served-answer census (0 diffs before and after across 4 dashboards, 35 views, the app list, 4 objects; admin and member; en and zh-CN; three phases): ANSWERED on the code trace in ① item 6 — no serving path can hand the dashboard translator a base on this head, so the number is what the trace predicts. The count itself is the dev's measurement and is not re-run here.
  4. "No documented rule reversed": ANSWERED, no reversal. translations.mdx "The authored label is the default locale's text … a zh-CN bundle still works and still wins" describes the fallback chain for a package's own label against its own bundle; a served string equal to its packaged counterpart still receives the catalog, and an inline locale map never counts as an override, so that page stays true. translations.mdx "published items layer over the file bundles, so an authored value wins over a shipped one" concerns translation items, untouched. ADR-0029 D9.2a's sentence "an explicit override beats a packaged default" governed the object catalog and the object fold; this PR applies the same predicate to a Regime O type and does not narrow or invert it. ADR-0126 Regime O (dashboards overlay-editable, the published overlay is what every read serves) is served by the change, not contradicted. No ADR says a catalog wins over an overlay, so no new ADR is owed; the ADR ids are left in the code (PD13). The dashboard sentence for translations.mdx rides on rest: the /meta dashboard item and list reads pass no packaged base to translateDashboard, so a published org overlay on a translated dashboard keeps the shipped widget title — per-layer child of #20680 #20730, correctly, since nothing is observable before it.
  5. Part of first line: ANSWERED in ②; consistent with the body, the card and the check.
  6. The throwaway REST measurement: ANSWERED. Never on the branch — the file list has no packages/rest path, which is what the claim (⛔ no REST edit on this branch) and triage (per-layer child) ordered; the nine-line face is rest: the /meta dashboard item and list reads pass no packaged base to translateDashboard, so a published org overlay on a translated dashboard keeps the shipped widget title — per-layer child of #20680 #20730, Blocked-by: #20728.
  7. out_of_scope_findings: ANSWERED. rest: the /meta dashboard item and list reads pass no packaged base to translateDashboard, so a published org overlay on a translated dashboard keeps the shipped widget title — per-layer child of #20680 #20730 (open; the REST per-layer child; body carries Blocked-by: #20728 and names both cards) and i18n: a published org overlay on a packaged view label is served to a zh-CN reader as the catalog translation (进行中), not the edit — the view twin of #20680 #20731 (open; the view twin) exist; the two noted carriers — objectui DashboardRenderer tWidgetTitle re-resolving client-side, and the translations.mdx sentence — are named on rest: the /meta dashboard item and list reads pass no packaged base to translateDashboard, so a published org overlay on a translated dashboard keeps the shipped widget title — per-layer child of #20680 #20730 by the seat answer. Nothing left unfiled.
  8. open_questions: both answered in-seat at 5900364303 (Q1 A: Clause-②: yes, both minor; Q2 A: dashboards only) and applied in the patch round; the delta report 5900438073 lists no open question. Nothing to escalate.
  9. Not flagged by the dev, checked anyway: no governed surface in the file list (no docs/adr/**, .claude/**, skills/**, AGENTS.md, CLAUDE.md); the ADR anchor over protocol.ts is an invariant statement (D9.8/D9.9, ADR-0119), untouched by a pure insertion; runtime strings carry no tracker number (the [#20680] mentions are comments and changeset prose).

Implemented-by: claude/issue-20680-builtin-dashboard-overlay-identity
Reviewed-by: session_01DEvba2nBuD4tWzfq8r8NFY

VERDICT: PASS


Generated by Claude Code

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review September 29, 2026 23:06
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Sep 29, 2026
Merged via the queue into main with commit 1940afd Sep 29, 2026
44 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-20680-builtin-dashboard-overlay-identity branch September 29, 2026 23:33
akarma-synetal pushed a commit to akarma-synetal/framework that referenced this pull request Oct 7, 2026
…elds to a published org overlay (objectstack-ai#20731) (objectstack-ai#20770)

Part of objectstack-ai#20731. This PR lands the two producer halves that triage
(5901376430) assigned to this card: the translator rule in
`@objectstack/spec` and the packaged-view accessor in
`@objectstack/metadata-protocol`. The card should stay open after this
merges, because the `/meta` view arm in `packages/rest` still hands no
base (see "Not in this PR"). Triage routes that arm onto objectstack-ai#20730's
per-type base resolver as one more arm. It is filed as a per-layer
child, or added to objectstack-ai#20730's PR, whichever the seats agree.

Clause-②: yes

## Reproduced first, at the translator and protocol layer

**Harness.** A scratch vitest file in `packages/objectql` (not
committed). It builds a real `SchemaRegistry` and registers a
`defineView` container the way the boot does: the container under the
bare object key, then each `expandViewContainer` item under its
qualified name with a package id. It uses the real
`ObjectStackProtocolImplementation` over a read-only in-memory
`sys_metadata` that holds one published org overlay row: `type: view`,
`name: showcase_task.in_progress`, `package_id: null`, the org, `state:
active`, label `In Progress (edited-20731)`. The catalog is keyed the
way the showcase ships it
(`objects.showcase_task._views.in_progress.label`, zh-CN `进行中`). I did
not run a real `/meta` boot. The HTTP reading is the objectstack-ai#20680 dev's probe3
(`os-dev-report` 5900307018), and this probe reproduces it one layer
down.

| reading | before (`origin/main` `33e4a5609c`) | after (this branch,
rebuilt `dist`) |
|---|---|---|
| `protocol.getMetaItem` label (org read) | `In Progress (edited-20731)`
| same |
| `protocol.getMetaItems` label (org read) | `In Progress
(edited-20731)` | same |
| served `_packageId` | `com.example.showcase` (the artifact envelope) |
same |
| `typeof protocol.getPackagedViewBase` | `undefined` | `function` |
| `translateView(served, zh-CN)`, no base | `进行中` | `进行中` (unchanged, by
design) |
| `translateView(served, zh-CN)`, handed the packaged view | **`进行中`**
(the base was ignored) | **`In Progress (edited-20731)`** |
| `translateMetadataDocument('view', …)` zh-CN, with base | `进行中` | `In
Progress (edited-20731)` |
| the same, en, with base | `In Progress (edited-20731)` | same |
| unedited sibling `showcase_task.urgent`, zh-CN | `紧急` | `紧急` |
| after reset (no overlay row): label, then zh-CN with base | `In
Progress`, `进行中` | same |

So the write and both protocol reads agree on one identity, and the
protocol serves the edit. The catalog applied over it because
`translateView` took no base: on `origin/main` its third parameter was
`ResolveOptions`, and it never read `packagedBase`, even when the
generic dispatcher passed one.

## Hypotheses (the dispatch's zone 2), and which held

- **H1: held, with one correction.** `translateView` was at
`i18n-resolver.ts:906` and `translateDashboard` at `:1407`. The
comparison is not written inline in `translateDashboard`. PR objectstack-ai#20728
already made it one private function, `valueOverridesPackagedBase`,
behind the exported `scalarOverridesPackagedBase`, so there was nothing
to extract. `translateView` now calls that same function, so there is no
second comparison. The dashboard-specific piece was the part finder
`packagedDashboardPart`, the lookup that finds the packaged counterpart
of a widget, filter or option by key. It is renamed to `packagedPart`,
its key union is widened, and both translators share it.
`translateDashboard`'s behaviour is unchanged (its 9 pins and the whole
spec suite are green).
- **H2: held.** `getPackagedDashboardBase` was at `protocol.ts:7194`.
The view base comes from the same source, `lookupArtifactItem`. Views
are **top-level registry items**. The objectql boot loop registers each
view that a `defineView` container expands to as its own `view` item,
under the qualified name `OBJECT.VIEW_KEY`, with the package id; it also
keeps the container under the bare object key.
`objects.OBJECT._views.VIEW_KEY` is only the catalog's layout, not a
registry shape. The base mirrors the registry item, which is also the
shape the overlay row and both reads carry. A view has no extension
fold, so the artifact item is the packaged declaration.
- **H3: the key.** The catalog key is
`objects.OBJECT._views.VIEW_KEY.label`, derived from the served name by
`viewTranslationKey`, which strips the `OBJECT.` prefix. **The base is
matched by the served view's registry identity, the qualified
`OBJECT.VIEW_KEY` name**, never by the bare key. The bare key is unique
only within one object; the showcase ships `in_progress` views on more
than one object. Pinned in `protocol-packaged-view-base.test.ts`:
`showcase_task.in_progress` and `showcase_project.in_progress` each
answer their own base, and the bare `in_progress` answers `undefined`.
At the translator, every pin hands a qualified-name served document
whose catalog sits under the bare key. I did not enumerate the example
apps for a view whose registered name differs from its container key
beyond the prefix. The only producer of that shape is
`expandViewContainer`'s collision rename, which the build-time view-ref
lint turns into a hard error.
- **H4: held, measured.** A scratch REST test (not committed) drove `GET
/api/v1/meta/view/:name` and `GET /api/v1/meta/view` through
`RestServer`'s real route handlers, against this branch's rebuilt
`@objectstack/spec`. The protocol double served the overlaid view and
implemented `getPackagedViewBase`. Results: item and list, zh-CN, `进行中`;
`getPackagedViewBase` called **0** times. `packagedObjectBaseOf` in
`meta-item-read-gate.ts` returns `undefined` for every type but
`object`. So the defect stays observable over HTTP until the `/meta`
view arm lands.

## What changes

- `translateView` takes `TranslateDocumentOptions`; it previously took
`ResolveOptions`, and the new type only adds the optional
`packagedBase`. When a base is supplied, the catalog replaces a string
only while that string still equals its packaged counterpart. The rule
is ADR-0029 D9.2a's, and it is the same one `translateObject` (objectstack-ai#8284)
and `translateDashboard` follow. It covers:
  - the view `label` and `description`;
  - each bulk-action def's `label`, `confirmText` and `confirmLabel`;
  - each param's `label`, `help` and `placeholder`.

A def or param is matched by the `name` the bundle addresses it by. One
that the base does not carry counts as authored ("a base that declares
no such scalar"). With no base, the output is byte-identical to before.
- Why the bulk-action copy is included: `translateView` translates those
strings too, and the rule belongs to the translator, not to one
attribute. Leaving them out would mean that when the base is handed, an
edited view label wins while an edited bulk-action label on the same
view still loses. The measured reading is the label. The bulk-action
cases are pinned but were not measured on a running app.
- `ObjectStackProtocolImplementation.getPackagedViewBase(name)` is the
view twin of `getPackagedDashboardBase`. Both now delegate to one
private `packagedArtifactBase(type, name)`: `lookupArtifactItem` and
nothing wider. It is shadow-immune to an overlay hydrated under the
plain registry key. It answers `undefined` for a view no code package
ships, for an unknown or empty name, and for a registry that cannot
answer. `getPackagedDashboardBase` answers exactly as before (its 8 pins
are green).

## Readers of the changed functions, and which served answers move

- `translateView` is reached through `translateMetadataDocument('view',
…)`. In the serving path, that means
`packages/rest/src/meta-item-read-gate.ts`, where
`translateMetaDocument` (item) and `translateMetaList` (list) pass
`packagedBase: packagedObjectBaseOf(…)`. That is `undefined` for `view`,
so no serving path supplies a view base today, and the new branch does
not run in production until the `/meta` view arm lands. Measured: H4
above. The CLI's `i18n-bulk-action-coverage` test drives `translateView`
without a base and is green (17 of 17).
- `getPackagedViewBase` has no caller yet; the `/meta` view arm will be
its first reader.
- `packagedPart` and `valueOverridesPackagedBase` are private.

## Published surface (for the Clause-② line)

- `@objectstack/spec`: no export is added, removed or renamed
(`check:api-surface`: "public API surface + factory signatures
unchanged"). One exported function's parameter type is widened:
`translateView`'s `opts` goes from `ResolveOptions` to
`TranslateDocumentOptions`, and every existing call still compiles.
- `@objectstack/metadata-protocol`: one new public method,
`getPackagedViewBase`, on the exported
`ObjectStackProtocolImplementation`.
- Both are widenings, so both changesets are `minor`, as the dispatch
ordered: `.changeset/20731-spec-view-catalog-override.md` and
`.changeset/20731-metadata-protocol-packaged-view-base.md`.

## No documented rule is reversed

A value equal to the packaged declaration still gets the catalog, and so
does a label written as an inline locale map, because only a string
counts as an override (pinned). That keeps the case
`content/docs/ui/translations.mdx` describes: a package's own label
against its own bundle. ADR-0029 D9.2a is applied one type further;
nothing is reversed.

## Tests

The code and pins below are at `a3f753cead`, which is the fix plus a
merge of `origin/main` `a51920f5fb`. The only later commit,
`64f4797662`, adds one ledger row to
`scripts/engine-double-contract.pinned.json`. The gates are at
`64f4797662`.

- `packages/spec/src/system/i18n-resolver.test.ts` gains a block of 12
tests:
  - the qualified-name vs bare-key identity;
  - an unedited view keeps every string translated;
  - an edited label is served in zh-CN and in `en`;
  - per-string judgement;
- every string kind (description, the def's three strings, the param's
three strings);
  - a tenant-added def or param;
  - no base as the pre-change control (the measured defect);
  - reset;
  - the ruled no-op edge and an inline locale-map label;
  - an unedited sibling view handed its own base;
  - no mutation of inputs;
  - the generic dispatcher.

  The whole spec `local` project: 576 files, 17003 passed, 1 todo.
- `packages/objectql/src/protocol-packaged-view-base.test.ts` has 10
tests against a real `SchemaRegistry` and the real protocol:
  - the packaged body by qualified name;
  - immunity to a plain-key overlay;
- the key (another object's same-key view; the bare key answers
`undefined`);
  - the three `undefined` answers;
  - a registry that cannot answer;
  - item and list reads serve the overlay (one identity);
- translation with the base serves the edit in zh-CN and `en`, on item
and list;
  - an unedited view stays translated;
  - the no-base control reproduces the defect;
  - reset.

  The objectql `local` project: 339 files, 6714 tests, all green.
- `@objectstack/metadata-protocol`: 190 files passed (3 skipped); 2792
tests passed (19 skipped).
- `typecheck` is green for:
  - spec, with `check:scripts-typecheck` and its test layer;
  - metadata-protocol;
  - objectql, with `tsconfig.scripts.json` and its test layer.
- **Reverse verification A** (spec, source-resolved,
`scripts/ablation-replace.mjs`). The mutation fed `translateView` no
base: `asRecord(opts?.packagedBase)` became `asRecord((opts as
any)?.ABLATION_20731)`. The anchor went from 1 to 0, and the blob went
from `1e7995c1148d` to `2f0943d33e2a`. `-t 20731` turned **5 of 12
red**: the edited label, every string kind, the tenant-added def or
param, reset, and the dispatcher. It was restored with blob equal to
HEAD and `git diff HEAD` empty. The per-string test stays green under
this mutation by construction: it guards the other direction,
withholding too much.
- **Reverse verification B** (the same mutation, through `dist`). The
spec was rebuilt, and `ablation-dist-preflight` found the marker in 4
built files. The objectql protocol pins turned **2 of 10 red**:
translation with the base (item and list, zh-CN and en), and reset.
Restore leg: restore, rebuild, `--absent` over 230 built files, tree
clean, 10 of 10 green.
- **Reverse verification C** (accessor, through metadata-protocol
`dist`). `getPackagedViewBase` was made to answer the plain registry
read, which is the shadow trap. After the rebuild the marker was in 2
built files, and **2 of 10** turned red: plain-key overlay immunity, and
the no-code-package case. Restore leg: rebuild, `--absent` over 24 built
files, tree clean, 10 of 10 green.
- Gates: `node scripts/pm/dispatch-gates.mjs --commands` derived 96
families at `64f4797662`, and I ran all 96. Three first answered
`PREREQUISITE NOT MET` because they needed built output:
`check:dual-build-cjs-loads`, `check:lean-entry-closure` and
`check:type-check-debt`. They exited 0 after `turbo run build` over
`./packages/*` and `./packages/*/*`. `--ran` reconciliation: "96
derived, 96 run, 0 NOT-MEASURED, 0 UNRUN".
`check:engine-double-contract` asked for the new double to be recorded,
so `scripts/engine-double-contract.pinned.json` gains one `findOne` row,
written by the gate's `--write`.
- Narrowed lint: `eslint --no-inline-config --format json` over the 4
TypeScript files in the diff reported 4 files, 0 errors and 0 warnings.
That population comes from the config's own `files` glob,
`**/*.{ts,tsx,mts,cts,js,jsx,mjs,cjs}`; the other 3 changed paths are
`.md` and `.json`. The config never enables type-aware linting (its own
comment says so: no `parserOptions.project`), so this diff cannot move
the verdict for an untouched file.

## Not in this PR

- **The `/meta` view arm (H4).** `packages/rest`'s item and list reads
still pass no view base, so `GET
/api/v1/meta/view/showcase_task.in_progress` and `GET /api/v1/meta/view`
in `zh-CN` keep serving `进行中` over a published overlay until that arm
lands. Triage routes it onto objectstack-ai#20730's per-type resolver as one more arm,
calling `getPackagedViewBase(name)` with the served qualified name. It
is not a second resolver. objectstack-ai#20730 is not addressed here.
- **Docs.** `content/docs/ui/translations.mdx` should state the view
rule once the rule is observable, next to objectstack-ai#20730's dashboard sentence.
- **The console.** I did not measure whether the console re-resolves
`_views` labels client-side over the served label (the dashboard twin's
acceptance notes flag that shape for widget titles). Its carrier is the
`/meta` view arm's browser verification.

## Acceptance notes

- **Dormant until the `/meta` arm.** With this PR alone, no served
answer changes. Measured at the REST route layer (H4), not in a real
boot.
- The branch merged `origin/main` at `a51920f5fb` before this PR opened.
Since then, `main` has taken 3 commits (`cba417a8f2`, `0d9349fea0`,
`7053333e1e`), and none of them touches these packages. The merge queue
rebuilds on the current `main`.

---
_Generated by [Claude
Code](https://claude.ai/code/session_01DEvba2nBuD4tWzfq8r8NFY)_

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation protocol:system size/l tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants